// Copyright 2025 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by sidekick. DO NOT EDIT.

#![allow(rustdoc::redundant_explicit_links)]
#![allow(rustdoc::broken_intra_doc_links)]
#![no_implicit_prelude]
extern crate bytes;
extern crate serde;
extern crate serde_json;
extern crate serde_with;
extern crate std;
extern crate wkt;

mod debug;
mod deserialize;
mod serialize;

/// Prediction input format for Image Classification.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ImageClassificationPredictionInstance {
    /// The image bytes or Cloud Storage URI to make the prediction on.
    pub content: std::string::String,

    /// The MIME type of the content of the image. Only the images in below listed
    /// MIME types are supported.
    ///
    /// - image/jpeg
    /// - image/gif
    /// - image/png
    /// - image/webp
    /// - image/bmp
    /// - image/tiff
    /// - image/vnd.microsoft.icon
    pub mime_type: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ImageClassificationPredictionInstance {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [content][crate::model::ImageClassificationPredictionInstance::content].
    pub fn set_content<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.content = v.into();
        self
    }

    /// Sets the value of [mime_type][crate::model::ImageClassificationPredictionInstance::mime_type].
    pub fn set_mime_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.mime_type = v.into();
        self
    }
}

impl wkt::message::Message for ImageClassificationPredictionInstance {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.aiplatform.v1.schema.predict.instance.ImageClassificationPredictionInstance"
    }
}

/// Prediction input format for Image Object Detection.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ImageObjectDetectionPredictionInstance {
    /// The image bytes or Cloud Storage URI to make the prediction on.
    pub content: std::string::String,

    /// The MIME type of the content of the image. Only the images in below listed
    /// MIME types are supported.
    ///
    /// - image/jpeg
    /// - image/gif
    /// - image/png
    /// - image/webp
    /// - image/bmp
    /// - image/tiff
    /// - image/vnd.microsoft.icon
    pub mime_type: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ImageObjectDetectionPredictionInstance {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [content][crate::model::ImageObjectDetectionPredictionInstance::content].
    pub fn set_content<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.content = v.into();
        self
    }

    /// Sets the value of [mime_type][crate::model::ImageObjectDetectionPredictionInstance::mime_type].
    pub fn set_mime_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.mime_type = v.into();
        self
    }
}

impl wkt::message::Message for ImageObjectDetectionPredictionInstance {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.aiplatform.v1.schema.predict.instance.ImageObjectDetectionPredictionInstance"
    }
}

/// Prediction input format for Image Segmentation.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ImageSegmentationPredictionInstance {
    /// The image bytes to make the predictions on.
    pub content: std::string::String,

    /// The MIME type of the content of the image. Only the images in below listed
    /// MIME types are supported.
    ///
    /// - image/jpeg
    /// - image/png
    pub mime_type: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ImageSegmentationPredictionInstance {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [content][crate::model::ImageSegmentationPredictionInstance::content].
    pub fn set_content<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.content = v.into();
        self
    }

    /// Sets the value of [mime_type][crate::model::ImageSegmentationPredictionInstance::mime_type].
    pub fn set_mime_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.mime_type = v.into();
        self
    }
}

impl wkt::message::Message for ImageSegmentationPredictionInstance {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.aiplatform.v1.schema.predict.instance.ImageSegmentationPredictionInstance"
    }
}

/// Prediction input format for Text Classification.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TextClassificationPredictionInstance {
    /// The text snippet to make the predictions on.
    pub content: std::string::String,

    /// The MIME type of the text snippet. The supported MIME types are listed
    /// below.
    ///
    /// - text/plain
    pub mime_type: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl TextClassificationPredictionInstance {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [content][crate::model::TextClassificationPredictionInstance::content].
    pub fn set_content<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.content = v.into();
        self
    }

    /// Sets the value of [mime_type][crate::model::TextClassificationPredictionInstance::mime_type].
    pub fn set_mime_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.mime_type = v.into();
        self
    }
}

impl wkt::message::Message for TextClassificationPredictionInstance {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.aiplatform.v1.schema.predict.instance.TextClassificationPredictionInstance"
    }
}

/// Prediction input format for Text Extraction.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TextExtractionPredictionInstance {
    /// The text snippet to make the predictions on.
    pub content: std::string::String,

    /// The MIME type of the text snippet. The supported MIME types are listed
    /// below.
    ///
    /// - text/plain
    pub mime_type: std::string::String,

    /// This field is only used for batch prediction. If a key is provided, the
    /// batch prediction result will by mapped to this key. If omitted, then the
    /// batch prediction result will contain the entire input instance. Vertex AI
    /// will not check if keys in the request are duplicates, so it is up to the
    /// caller to ensure the keys are unique.
    pub key: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl TextExtractionPredictionInstance {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [content][crate::model::TextExtractionPredictionInstance::content].
    pub fn set_content<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.content = v.into();
        self
    }

    /// Sets the value of [mime_type][crate::model::TextExtractionPredictionInstance::mime_type].
    pub fn set_mime_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.mime_type = v.into();
        self
    }

    /// Sets the value of [key][crate::model::TextExtractionPredictionInstance::key].
    pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.key = v.into();
        self
    }
}

impl wkt::message::Message for TextExtractionPredictionInstance {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.aiplatform.v1.schema.predict.instance.TextExtractionPredictionInstance"
    }
}

/// Prediction input format for Text Sentiment.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TextSentimentPredictionInstance {
    /// The text snippet to make the predictions on.
    pub content: std::string::String,

    /// The MIME type of the text snippet. The supported MIME types are listed
    /// below.
    ///
    /// - text/plain
    pub mime_type: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl TextSentimentPredictionInstance {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [content][crate::model::TextSentimentPredictionInstance::content].
    pub fn set_content<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.content = v.into();
        self
    }

    /// Sets the value of [mime_type][crate::model::TextSentimentPredictionInstance::mime_type].
    pub fn set_mime_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.mime_type = v.into();
        self
    }
}

impl wkt::message::Message for TextSentimentPredictionInstance {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.aiplatform.v1.schema.predict.instance.TextSentimentPredictionInstance"
    }
}

/// Prediction input format for Video Action Recognition.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct VideoActionRecognitionPredictionInstance {
    /// The Google Cloud Storage location of the video on which to perform the
    /// prediction.
    pub content: std::string::String,

    /// The MIME type of the content of the video. Only the following are
    /// supported: video/mp4 video/avi video/quicktime
    pub mime_type: std::string::String,

    /// The beginning, inclusive, of the video's time segment on which to perform
    /// the prediction. Expressed as a number of seconds as measured from the
    /// start of the video, with "s" appended at the end. Fractions are allowed,
    /// up to a microsecond precision.
    pub time_segment_start: std::string::String,

    /// The end, exclusive, of the video's time segment on which to perform
    /// the prediction. Expressed as a number of seconds as measured from the
    /// start of the video, with "s" appended at the end. Fractions are allowed,
    /// up to a microsecond precision, and "inf" or "Infinity" is allowed, which
    /// means the end of the video.
    pub time_segment_end: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl VideoActionRecognitionPredictionInstance {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [content][crate::model::VideoActionRecognitionPredictionInstance::content].
    pub fn set_content<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.content = v.into();
        self
    }

    /// Sets the value of [mime_type][crate::model::VideoActionRecognitionPredictionInstance::mime_type].
    pub fn set_mime_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.mime_type = v.into();
        self
    }

    /// Sets the value of [time_segment_start][crate::model::VideoActionRecognitionPredictionInstance::time_segment_start].
    pub fn set_time_segment_start<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.time_segment_start = v.into();
        self
    }

    /// Sets the value of [time_segment_end][crate::model::VideoActionRecognitionPredictionInstance::time_segment_end].
    pub fn set_time_segment_end<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.time_segment_end = v.into();
        self
    }
}

impl wkt::message::Message for VideoActionRecognitionPredictionInstance {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.aiplatform.v1.schema.predict.instance.VideoActionRecognitionPredictionInstance"
    }
}

/// Prediction input format for Video Classification.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct VideoClassificationPredictionInstance {
    /// The Google Cloud Storage location of the video on which to perform the
    /// prediction.
    pub content: std::string::String,

    /// The MIME type of the content of the video. Only the following are
    /// supported: video/mp4 video/avi video/quicktime
    pub mime_type: std::string::String,

    /// The beginning, inclusive, of the video's time segment on which to perform
    /// the prediction. Expressed as a number of seconds as measured from the
    /// start of the video, with "s" appended at the end. Fractions are allowed,
    /// up to a microsecond precision.
    pub time_segment_start: std::string::String,

    /// The end, exclusive, of the video's time segment on which to perform
    /// the prediction. Expressed as a number of seconds as measured from the
    /// start of the video, with "s" appended at the end. Fractions are allowed,
    /// up to a microsecond precision, and "inf" or "Infinity" is allowed, which
    /// means the end of the video.
    pub time_segment_end: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl VideoClassificationPredictionInstance {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [content][crate::model::VideoClassificationPredictionInstance::content].
    pub fn set_content<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.content = v.into();
        self
    }

    /// Sets the value of [mime_type][crate::model::VideoClassificationPredictionInstance::mime_type].
    pub fn set_mime_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.mime_type = v.into();
        self
    }

    /// Sets the value of [time_segment_start][crate::model::VideoClassificationPredictionInstance::time_segment_start].
    pub fn set_time_segment_start<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.time_segment_start = v.into();
        self
    }

    /// Sets the value of [time_segment_end][crate::model::VideoClassificationPredictionInstance::time_segment_end].
    pub fn set_time_segment_end<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.time_segment_end = v.into();
        self
    }
}

impl wkt::message::Message for VideoClassificationPredictionInstance {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.aiplatform.v1.schema.predict.instance.VideoClassificationPredictionInstance"
    }
}

/// Prediction input format for Video Object Tracking.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct VideoObjectTrackingPredictionInstance {
    /// The Google Cloud Storage location of the video on which to perform the
    /// prediction.
    pub content: std::string::String,

    /// The MIME type of the content of the video. Only the following are
    /// supported: video/mp4 video/avi video/quicktime
    pub mime_type: std::string::String,

    /// The beginning, inclusive, of the video's time segment on which to perform
    /// the prediction. Expressed as a number of seconds as measured from the
    /// start of the video, with "s" appended at the end. Fractions are allowed,
    /// up to a microsecond precision.
    pub time_segment_start: std::string::String,

    /// The end, exclusive, of the video's time segment on which to perform
    /// the prediction. Expressed as a number of seconds as measured from the
    /// start of the video, with "s" appended at the end. Fractions are allowed,
    /// up to a microsecond precision, and "inf" or "Infinity" is allowed, which
    /// means the end of the video.
    pub time_segment_end: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl VideoObjectTrackingPredictionInstance {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [content][crate::model::VideoObjectTrackingPredictionInstance::content].
    pub fn set_content<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.content = v.into();
        self
    }

    /// Sets the value of [mime_type][crate::model::VideoObjectTrackingPredictionInstance::mime_type].
    pub fn set_mime_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.mime_type = v.into();
        self
    }

    /// Sets the value of [time_segment_start][crate::model::VideoObjectTrackingPredictionInstance::time_segment_start].
    pub fn set_time_segment_start<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.time_segment_start = v.into();
        self
    }

    /// Sets the value of [time_segment_end][crate::model::VideoObjectTrackingPredictionInstance::time_segment_end].
    pub fn set_time_segment_end<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.time_segment_end = v.into();
        self
    }
}

impl wkt::message::Message for VideoObjectTrackingPredictionInstance {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.aiplatform.v1.schema.predict.instance.VideoObjectTrackingPredictionInstance"
    }
}
